//
//  ViewController.swift
//  XKPageView
//
//  Created by 徐凯 on 2017/6/6.
//  Copyright © 2017年 XK. All rights reserved.
//

import UIKit

class ViewController: UIViewController {

    override func viewDidLoad() {
        super.viewDidLoad()
        view.backgroundColor = UIColor.green
        let titles = ["推荐", "游戏", "娱乐", "趣玩", "游戏", "娱乐", "趣玩a", "游戏sss", "娱乐", "趣玩sa"]
        automaticallyAdjustsScrollViewInsets = false
        var childVCs = [UIViewController]()
        for _ in 0..<titles.count{
            let vc = UIViewController()
            vc.view.backgroundColor = UIColor.randomColor()

            childVCs .append(vc)
        }
        
        var style = XKPageStyle()
        style.isScrollEnable = true
        
        let pageview = XKPageView(frame: CGRect(x: 0, y: 64, width: view.bounds.width, height: view.bounds.height - 64), titles: titles, style: style, childVCs: childVCs, parentVC: self)
        view.addSubview(pageview)
        
    }


}

